<template>
  <div>
    <button @click="getStudentsInfo">获取学生信息</button>
    <button @click="getCarsInfo">获取学生信息</button>
  </div>
</template>

<script>
import axios from 'axios';
export default {
  name: 'my-demo',
  methods: {
    getStudentsInfo() {
      axios.get('http://localhost:8080/students')
      .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
        console.log(error.message);
      })
    },
    getCarsInfo() {
      axios.get('http://localhost:8080/che/cars')
      .then(function (response) {
        console.log(response.data);
      })
      .catch(function (error) {
        console.log(error);
      })
    }
  }
}
</script>